import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
import {defHttp} from "@/utils/http/axios";
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '指标类型',
    align:"center",
    dataIndex: 'zhibiaoleixing_dictText'
   },
   {
    title: '考核指标',
    align:"center",
    dataIndex: 'kaohezhibiao'
   },
   {
    title: '权重',
    align:"center",
    dataIndex: 'quanzhong'
   },
   {
    title: '指标定义及公式',
    align:"center",
    dataIndex: 'zhibiaodingyijigongshi'
   },
   {
    title: '评价细则',
    align:"center",
    dataIndex: 'pingjiaxize'
   },
   {
    title: '责任部门',
    align:"center",
    dataIndex: 'zerenbumen_dictText'
   },
   {
    title: '基本目标值',
    align:"center",
    dataIndex: 'jibenmubiaozhi'
   },
   {
    title: '激励目标值',
    align:"center",
    dataIndex: 'jilimubiaozhi'
   },
   {
    title: '驳回情况',
    align:"center",
    dataIndex: 'bohuiqingkuang_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '指标类型',
    field: 'zhibiaoleixing',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"zhibiaoleixing"
     },
  },
  {
    label: '考核指标',
    field: 'kaohezhibiao',
    component: 'InputTextArea',
  },
  {
    label: '权重',
    field: 'quanzhong',
    component: 'InputNumber',
  },
  {
    label: '指标定义及公式',
    field: 'zhibiaodingyijigongshi',
    component: 'InputTextArea',
  },
  {
    label: '评价细则',
    field: 'pingjiaxize',
    component: 'InputTextArea',
  },
  {
    label: '基本目标值',
    field: 'jibenmubiaozhi',
    component: 'Input',
  },
  {
    label: '激励目标值',
    field: 'jilimubiaozhi',
    component: 'Input',
  },
  {
    label: '工作落实计划',
    field: 'gongzuoluoshijihua',
    component: 'InputTextArea',
  },
  {
    label: '指标要求',
    field: 'zhibiaoyaoqiu',
    component: 'Input',
  },
  {
    label: '具体落实情况',
    field: 'jutiluoshiqingkuang',
    component: 'InputTextArea',
  },
  {
    label: '配合部门',
    field: 'peihebumen',
    component: 'JSelectMultiple',
    componentProps: {
      options: [], // 初始为空
      placeholder: '请选择配合部门'
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  zhibiaoleixing: {title: '指标类型',order: 0,view: 'list', type: 'string',dictCode: '',},
  koahezhibiao: {title: '考核指标',order: 1,view: 'textarea', type: 'string',},
  quanzhong: {title: '权重',order: 2,view: 'number', type: 'number',},
  zhibiaodingyijigongshi: {title: '指标定义及公式',order: 3,view: 'textarea', type: 'string',},
  pingjiaxize: {title: '评价细则',order: 4,view: 'textarea', type: 'string',},
  zerenbumen: {title: '责任部门',order: 5,view: 'text', type: 'string',},
  jibenmubiaozhi: {title: '基本目标值',order: 6,view: 'text', type: 'string',},
  jilimubiaozhi: {title: '激励目标值',order: 7,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
